home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1810 / 1810.xpi / chrome / showcase.jar / content / settings / pref-window.js < prev    next >
Text File  |  2010-01-17  |  3KB  |  42 lines

  1. function windowPrefInit() {
  2.   // Check all enable/disable dependancies
  3.   windowWidthChanged();
  4.   windowHeightChanged();
  5.   windowCustomColorsChanged();
  6.   windowScrollTypeChanged();
  7. }
  8.  
  9. function windowWidthChanged() {
  10.   var windowWidthComboBox = document.getElementById("windowWidth");
  11.   document.getElementById("windowWidthPercentageLabel").disabled = (windowWidthComboBox.selectedIndex == 3);
  12.   document.getElementById("windowWidthPercentageSymbolLabel").disabled = (windowWidthComboBox.selectedIndex == 3);
  13.   document.getElementById("windowWidthPercentage").disabled = (windowWidthComboBox.selectedIndex == 3);
  14.   document.getElementById("windowWidthModifierLabel").disabled = (windowWidthComboBox.selectedIndex == 3);
  15.   document.getElementById("windowWidthModifierUnitLabel").disabled = (windowWidthComboBox.selectedIndex == 3);
  16.   document.getElementById("windowWidthModifier").disabled = (windowWidthComboBox.selectedIndex == 3);
  17. }
  18.  
  19. function windowHeightChanged() {
  20.   var windowHeightComboBox = document.getElementById("windowHeight");
  21.   document.getElementById("windowHeightPercentageLabel").disabled = (windowHeightComboBox.selectedIndex == 3);
  22.   document.getElementById("windowHeightPercentageSymbolLabel").disabled = (windowHeightComboBox.selectedIndex == 3);
  23.   document.getElementById("windowHeightPercentage").disabled = (windowHeightComboBox.selectedIndex == 3);
  24.   document.getElementById("windowHeightModifierLabel").disabled = (windowHeightComboBox.selectedIndex == 3);
  25.   document.getElementById("windowHeightModifierUnitLabel").disabled = (windowHeightComboBox.selectedIndex == 3);
  26.   document.getElementById("windowHeightModifier").disabled = (windowHeightComboBox.selectedIndex == 3);
  27. }
  28.  
  29. function windowCustomColorsChanged() {
  30.   var windowCustomColorsCheckbox = document.getElementById("windowCustomColors");
  31.   document.getElementById("windowCustomBackgroundColorLabel").disabled = !windowCustomColorsCheckbox.checked;
  32.   document.getElementById("windowCustomBackgroundColor").disabled = !windowCustomColorsCheckbox.checked;
  33. }
  34.  
  35. function windowScrollTypeChanged() {
  36.   var windowScrollTypeComboBox = document.getElementById("windowScrollType");
  37.   document.getElementById("windowThumbnailPreferredMinimumSizeLabel").disabled = (windowScrollTypeComboBox.selectedIndex == 0);
  38.   document.getElementById("windowThumbnailPreferredMinimumSizePixelsLabel").disabled = (windowScrollTypeComboBox.selectedIndex == 0);
  39.   document.getElementById("windowThumbnailPreferredMinimumSize").disabled = (windowScrollTypeComboBox.selectedIndex == 0);
  40.   document.getElementById("windowAlwaysShowScrollbar").disabled = (windowScrollTypeComboBox.selectedIndex == 0);
  41. }
  42.